imageGallery Plugin class
This class reads an folder and creates a gallery out of the pictures in it.
Also looks if a "texts.txt" or "captions.txt" exists, to get image captions. The captions in this file must have the following format: filename.jpg###Text which sould apear under the image, when zoomed in otherFilname.png###Another text which describes the picture ...
Note: works only with "png", "gif" and "jpg" or "jpeg" filetypes. Note: The image gallery is surrounded by an '<div class="feinduraPlugin_imageGallery">' tag to help to style the image gallery.
string | $documentRoot | You can set the document root manually. |
bool | $xHtml | TRUE when the pages content should be handled as XHTML |
int | $resizeWhenSmaller | TRUE when images shopuld also be resized, even if they are smaller, than the set width, or height values. |
int | $keepRatio | If TRUE the original ratio will be used, when resizing the images. |
int | $imageWidth | The maximal width of the pictures |
int | $imageHeight | The maximal height of the pictures |
int | $thumbnailWidth | The maximal width of the thumbnails of the pictures |
int | $thumbnailHeight | The maximal height of the thumbnails of the pictures |
bool | $emptyImage | A path to and 1px x 1px empty gif image, which is needed when adding the image as background when specifing width and height. |
bool | $filenameCaptions | If this is TRUE it uses the filename as captions, when no line in a captions.txt exist for this file. |
int | $resetTimestamp | If This timestamp is newer than the thumbnails modification timestamp, it will resize the thumbnails again. |
array | $images | An array which contains all image filenames and paths |
int | $uniqueId | A unique ID which each imageGallery gets to separate them. |
void | __construct() | The constructor of the class, sets all basic properties. Also looks if a "texts.txt" or... |
void | __destruct() | |
bool | resizeImages() | Resize the images to the size set in the imageGallery::$imageWidth and imageGallery::$imageHeight property. |
bool | createThumbnails() | Resize the images to the size set in the imageGallery::$thumbnailWidth and imageGallery::$thumbnailHeight... |
array | getImages() | Generates the image links and return them in an array. When both the thumbnail width and height are set, then it... |
string | showGallery() | Generates the gallery for displaying in an HTML-page Note : The image gallery is surrounded by an '<div... |
TRUE when the pages content should be handled as XHTML
In XHTML standalone tags end with " />" instead of ">".
Therefor when a page content is displayed and this property is FALSE all " />" will be changed to ">".
TRUE when images shopuld also be resized, even if they are smaller, than the set width, or height values.
If TRUE the original ratio will be used, when resizing the images.
If this property is FALSE and only width or height is set, it even though keeps the ratio.
The maximal width of the pictures
All pictures will be resized to this width when the imageGallery::resizeImages() method is called.
Note: If the imageGallery::$imageHeight property is null, it keeps the aspect ratio of the images.
The maximal height of the pictures
All pictures will be resized to this height when the resizeImages() method is called.
Note: If the imageGallery::$imageWidth property is null, it keeps the aspect ratio of the images.
The maximal width of the thumbnails of the pictures
the thumbnails will be created with this width when the imageGallery::createThumbanils() method is called.
Note: If the imageGallery::$thumbnailHeight property is null, it keeps the aspect ratio of the images.
The maximal height of the thumbnails of the pictures
the thumbnails will be created with this height when the imageGallery::createThumbanils() method is called.
Note: If the imageGallery::$thumbnailWidth property is null, it keeps the aspect ratio of the images.
A path to and 1px x 1px empty gif image, which is needed when adding the image as background when specifing width and height.
If this is TRUE it uses the filename as captions, when no line in a captions.txt exist for this file.
If This timestamp is newer than the thumbnails modification timestamp, it will resize the thumbnails again.
void Constructor __construct ( |
$jsonImages, [ $baseFolder = false], [ $documentRoot = false], string $folder) |
string | $folder |
the absolut path of the folder from where a gallery should be created |
$jsonImages |
Default false | |
$baseFolder |
Default false | |
$documentRoot |
|
Type constructor
The constructor of the class, sets all basic properties.
Also looks if a "texts.txt" or "captions.txt" exists, to get image captions. The captions in this file must have the following format: filename.jpg###Text which sould apear under the image, when zoomed in otherFilname.png###Another text which describes the picture ...
Name resizeImages()
Resize the images to the size set in the imageGallery::$imageWidth and imageGallery::$imageHeight property.
Name createThumbnails()
Resize the images to the size set in the imageGallery::$thumbnailWidth and imageGallery::$thumbnailHeight property and copy them to a "thumbnails/" subfolder.
Name getImages()
Generates the image links and return them in an array. When both the thumbnail width and height are set, then it will add the image as background to the <img> tag. This ensures that all images have the same size.
string | $tag |
the tag used to create the gallery, can be "ul","menu", "table" or FALSE to return just images |
int | $breakAfter |
(optional) if the $tag parameter is "table" then it defines the number after which the table makes a new row Default false |
Name showGallery()
Generates the gallery for displaying in an HTML-page
Note: The image gallery is surrounded by an '<div class="feinduraPlugin_imageGallery">' tag to help to style the image gallery.